@inject('cartService','App\Interfaces\CartService')

<?php
$total_number = $cartService->getCartNumber();
?>

<div class="header">
    <!--顶部工具条-->
    <div class="h-tools fn-clear">
        <ul class="inbox navlist nav-def">
            <!--顶部右侧-->
            <li class="nav_r navlevel last">
                <ul class="subnav subnav-r">
                    <li>
                        <a target="_blank" href="http://weibo.com/">新浪微博</a>
                        <div class="code-pic">
                            <img src="{{ URL::asset('/') }}images/2dcode-wb.jpg" alt="">
                            <span class="caret-r"><span class="caret-r"></span></span>
                        </div>
                    </li>
                    <li>
                        <a target="_blank" href="javascript:;">微信公众号</a>
                        <div class="code-pic">
                            <img src="{{ URL::asset('/') }}images/2dcode-wb.jpg" alt="">
                            <span class="caret-r"><span class="caret-r"></span></span>
                        </div>
                    </li>
                </ul>
                <span class="sep">|</span><a href="javascript:;">更多<span class="caret-b transform"></span></a>
            </li>
            <li class="nav_r"><a href="/help/notice">消费者告知书</a></li>
            <li class="nav_r navlevel">
                <span class="sep">|</span><a>客户服务<span class="caret-b transform"></span></a><span class="sep">|</span>
                <ul class="subnav">
                    <li><a href="http://wpa.qq.com/msgrd?v=3&uin=3039215126&site=qq&menu=yes" target="_blank">联系客服</a></li>
                    <li><a href="/help/common" target="_blank">帮助中心</a></li>
                </ul>
            </li>
            <li class="nav_r navlevel">
                <a href="/my/center">个人中心<span class="caret-b transform"></span></a><span class="sep">&nbsp;</span>
                <ul class="subnav">
                    <li><a href="/my/order">我的订单</a></li>
                    <li><a href="/my/collection">我的收藏</a></li>
                    <li><a href="/my/address">收货地址</a></li>
                    <li><a href="/my/account_safe">账号安全</a></li>
                </ul>
            </li>
            </li>
            <li class="nav_r"><a href="/my/order">我的订单</a><span class="sep">|</span></li>
            <!--END/顶部右侧-->

            <!--顶部左侧-->
            @if (!Auth::check())
                <li class="nav_l"><span class="fn-mr10">欢迎来到阿福易购</span><span class="sep">|</span></li>
                <li class="nav_l"><a href="/user/logi">请登录</a><span class="sep">|</span></li>
                <li class="nav_l"><a href="/user/register">快速注册</a><span class="sep">|</span></li>
            @else
                @if (Session::get('user_name'))
                    <li class="nav_l"><span class="fn-mr10">你好,</span><span class="text-color-1 fn-ml4 fn-mr10">{{Session::get('user_name')}}</span><span class="sep">|</span></li>
                    <li class="nav_l"><a href="/user/logout">退出</a></li>
                @else
                    <li class="nav_l"><span class="fn-mr10">你好,</span><span class="text-color-1 fn-ml4 fn-mr10">{{Auth::user()->user_name}}</span><span class="sep">|</span></li>
                    <li class="nav_l"><a href="/user/logout">退出</a></li>
                @endif
            @endif

            <li class="nav_l navlevel">
                <span class="sep">|</span><a href="javascript:;"><span class="icon icon-mobile"></span>手机客户端</a>
                <ul class="subnav">
                    <li><a href="#">上线中，敬请期待！</a></li>
                </ul>
            </li>
            <!--END/顶部左侧-->
        </ul>
    </div>
    <!--END/顶部工具条-->

    <!--顶部搜索&LOGO-->
    @inject('solrService','App\Interfaces\SolrService')
    <?php $hotKeywords = $solrService->suggest('',7); ?>
    <?php if (isset($filter['keyword'])&&$filter['keyword']!='') {$keyword=$filter['keyword'];}else{$keyword=$hotKeywords->first()['keyword'];}?>
    <div class="ui-box1 inbox h-search fn-clear fn-rel <?php if(!isset($noTopNav)){ echo 'has-cart'; } ?>">
        <div class="fn-fr fn-rel">
            <!--搜索框-->
            <div class="search-box <?php if(isset($noTopNav)){ echo 'fn-mt14'; } ?>" style="margin-right:0px;">
                {!! Form::open(['url'=>'/search?','class'=>'bl-form search-skin1','method'=>'get','target'=>'_blank']) !!}
                    <div class="fn-dib fn-rel fn-ohide keybox">
                        <input type="text" name="keyword" data-url="/search/suggestion" placeholder="{{$keyword}}" autocomplete="off" class="js-autocomplete fn-tinput fn-tinput-long key fn-fl">
                        <span class="fn-dib submit">
                            <button class="fn-btn btn-submit" type="submit">搜 索</button>
                        </span>
                    </div>
                </form>
            </div>
            <!--END/搜索框-->
        </div>

        <!--LOGO-->
        <div class="logo-wrap">
            <a href="/">
                <img class="logo" src="{{ URL::asset('/') }}images/logo.jpg" alt="logo">
            </a>
        </div>
        <!--END/LOGO-->
    </div>
    <!--END/顶部搜索&LOGO-->



</div>